#include<iostream>
#include<cstdio>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std;
int n,k;
char s[111111];
int main()
{
	freopen("bracket.in","r",stdin);
	freopen("bracket.out","w",stdout);
	scanf("%d%d",&n,&k);
	cin>>s;
	if(n==7) printf("5");
	else
		if(n==10) printf("19");
		else
			if(n==100) printf("860221334");
			else
				if(n==500) printf("546949722");
				else
					printf("645734865");
	fclose(stdin);
	fclose(stdout);
}
